<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('order/index')}">订单列表</a></li>
        <li><a href="{:url('order/receipt')}">包裹列表</a></li>
        <li><a href="{:url('order/unreceipt')}">异常包裹</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('order/index')}">
        <input class="form-control" type="text" name="keyword" style="" value="{:input('keyword', '')}" placeholder="会员ID/订单号/商品名字">
        <select name="order_status" id="" class="form-control">
            <volist name="status" id="vo">
                <option value="{$key}" {:input('status', -1)==$key?'selected':''}>{$vo}</option>
            </volist>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索">
        <a class="btn btn-danger" href="{:url('order/index?order_status=-1')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form" action="{:url('order/batchdel')}">
        <div class="table-actions">
            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">批量删除</button>
        </div>
        <div class="row">
            <table class="table table-hover table-bordered table-striped table-condensed">
                <thead>
                <tr>
                    <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></th>
                    <th>ID</th>
                    <th>订单编号</th>
                    <th>会员信息</th>
                    <th>商品信息</th>
                    <th>包裹数</th>
                    <th>订单金额</th>
                    <th>订单状态</th>
                    <th>时间</th>
                    <th>{:lang('ACTIONS')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="list" item="vo">
                    <tr>
                        <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo['order_no']}</td>
                        <td>会员id：{$vo['user_id']}<br>会员昵称：{$vo.user_nickname}</td>
                        <td><img src="{:cmf_get_image_url($vo.image)}" alt="" style="max-width: 80px; max-height: 80px"></td>
                        <td>{$vo['order_name']}×{$vo.package_num}</td>
                        <td>商品：{$vo.order_price}<br>运费：{$vo.freight_money}</td>
                        <td>{$vo['cn_status']}</td>
                        <td>
                            下单时间：{:date('Y-m-d H:i:s',$vo['add_time'])}<br>
                            支付时间：{$vo.pay_time ? date('Y-m-d H:i',$vo['pay_time']) : '-'}<br>
                        </td>
                        <td>
<!--                            <a class="btn btn-xs btn-primary" href="{:url('order/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>-->
                            <a class="btn btn-xs btn-danger" href="{:url('order/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                            <gt name="$vo.order_status" value="0">
                                <a class="btn btn-sm btn-info" href="{:url('order/receipt', ['order_id'=>$vo.id])}">包裹</a>
                            </gt>
                            <switch $vo.order_status>
                                <case 1><a class="btn btn-xs btn-warning js-ajax-dialog-btn" data-msg="确定要修改状态为可发货吗？" href="{:url('order/changestatus',array('id'=>$vo['id'],'status'=>2))}">可发货</a></case>
                                <case 2><a class="btn btn-xs btn-danger js-ajax-dialog-btn" data-msg="确定要修改状态为已发货吗？" href="{:url('order/changestatus',array('id'=>$vo['id'],'status'=>3))}">已发货</a></case>
                            </switch>

                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            <div class="pagination">{$list->render()}</div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    $(function () {

    })
</script>
</body>
</html>